//
// Created by wze-zero on 2024/9/13 013.
//
#include <iostream>

using namespace std;

bool test(int num) {
    while (num != 0) {
        if (num % 10 == 9) {
            return true;
        } else {
            num /= 10;
        }
    }
    return false;
}

int main() {
    int n = 0;
    for (int i = 1; i < 2020; ++i) {
        test(i) ? n++ : n;
    }
    cout << n << endl;
    return 0;
}